import {ActionSheetController} from "ionic-angular";
import {ZQHCamera} from "../util/zqhCamera";
/**
 * Created by Administrator on 2018/1/13.
 * 在使用该组件时，先在app.scss中写入以下样式
.action-sheet-md {
  text-align: center;
}
.action-sheet-md .action-sheet-container {
  padding: 0 5px;
}
.action-sheet-md .action-sheet-group {
  overflow: hidden;
  margin-bottom: 5px;
  border-radius: 5px;
  background: #f9f9f9;
}
.action-sheet-md .action-sheet-group:last-child {
  margin-bottom: 10px;
}
.action-sheet-md .action-sheet-title {
  padding: 1.5rem;
  border-bottom: 0.55px solid #d6d6da;
  border-radius: 0;
  font-size: 16px;
  text-align: center;
  color: #666666;
}

.action-sheet-md .action-sheet-button {
  margin: 0;
  padding: 5px;
  height: 50px;
  border-bottom: 0.55px solid #d6d6da;
  font-size: 20px;
  color: #007aff;
  background: transparent;
  text-align: center;
}
.action-sheet-md .action-sheet-button:last-child {
  border-bottom: 0;
}
.action-sheet-md .action-sheet-button.activated {
  margin-top: -0.55px;
  border-top: 0.55px solid #ebebeb;
  border-bottom-color: #ebebeb;
  background: #ebebeb;
}
.action-sheet-md .action-sheet-selected {
  background: #fff;
}
.action-sheet-md .action-sheet-destructive {
  font-size: 20px;
  color: #007aff;
}
.action-sheet-md .action-sheet-cancel {
  font-size: 20px;
  background: #fff;
}
.action-sheet-md .action-sheet-group .button-inner {
  -webkit-box-pack: start;
  -webkit-justify-content: center;
  -ms-flex-pack: start;
  justify-content: center;
}
**/
export class WgActionSheet{
  public static actionSheetCtrl: ActionSheetController;
  public static  presentActionSheet(callback) {
    let actionSheet = this.actionSheetCtrl.create({
      title: '请选择获取图片的方式',
      buttons: [
        {
          text: '拍照',
          handler: () => {
            console.log('Destructive clicked');
           callback(0);
          }
        },{
          text: '相册',
          handler: () => {
            console.log('Archive clicked');
            callback(1);
          }
        },{
          text: '取消',
          role: 'cancel',
          handler: () => {
            console.log('Cancel clicked');
          }
        }
      ]
    });
    actionSheet.present();
  }
}
